/**
 * 
 */
package com.momosw.games.jericho.board;

/**
 * <b>Project:</b> JerichoCardGame<br />
 * <b>Package:</b> com.momosw.games.jericho.board<br />
 * <b>Class:</b> WallCard.java<br />
 * <br />
 * <i>GSI 2011</i><br />
 *
 * @author Miguel Coronado (miguelcb84@gmail.com)
 * @version	Aug 20, 2011
 *
 */
public class WallCard extends Card implements HasLenghtCard{


    private WallType wallType;
    private int lenght;
    
    public WallCard (WallType wallType, int length) {
        this.wallType = wallType;
        this.lenght = length;
    }
    
    /**
     * @return the wallType
     */
    public WallType getWallType() {
        return wallType;
    }
    
    /**
     * @return the lenght
     */
    public int getLenght() {
        return lenght;
    }
    
    /*
     * (non-Javadoc)
     * @see com.momosw.games.engine.Option#getReadableName()
     */
    public String getReadableName() {
        return "Carta de muro: " + getWallType() + "-" +  getLenght();
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        WallCard other = (WallCard) obj;
        if (lenght != other.lenght)
            return false;
        if (wallType != other.wallType)
            return false;
        return true;
    }

    public String toString () {
        return getWallType().toString().substring(0, 2) + getLenght();
    }
    
}
